package com.codefish;

/**
 * 默认简历生成器类
 *
 * @author codefish
 * @version 1.0
 * @date 2022/06/07 下午 11:11
 */
public class DefaultResumeBuilder extends AbstractResumeBuilder {
    /**
     * 简历生成器的标签
     */
    private static final String BUILDER_NAME = "默认简历生成器";

    public DefaultResumeBuilder() {
        super();
        System.out.println("感谢您使用[" + BUILDER_NAME + "](✿◕‿◕✿)---------");
    }

    @Override
    public DefaultResumeBuilder name(String name) {
        System.out.println("正在填写\"姓名\"栏 o(≧▽≦)o ---------");
        resume.setName(name);
        return this;
    }

    @Override
    public DefaultResumeBuilder age(Integer age) {
        if (age <= 0) {
            throw new IllegalArgumentException("年龄要大于0哈~（；´д｀）ゞ");
        }
        System.out.println("正在填写\"年龄\"栏<(￣ c￣)y▂ξ---------");
        resume.setAge(age);
        return this;
    }

    @Override
    public DefaultResumeBuilder sex(String sex) {
        System.out.println("正在填写\"性别\"栏(*/ω＼*)--------");
        resume.setSex(sex);
        return this;
    }

    @Override
    public DefaultResumeBuilder telNumber(String telNumber) {
        System.out.println("正在填写\"联系电话\"栏ψ(｀∇´)ψ---------");
        resume.setTelNumber(telNumber);
        return this;
    }

    @Override
    public DefaultResumeBuilder city(String city) {
        System.out.println("正在填写\"居住城市\"栏(/≧▽≦)/---------");
        resume.setCity(city);
        return this;
    }

    @Override
    public Resume build() {
        System.out.println("--------简历制作完成啦~(￣y▽,￣)╭ ---------");
        return resume;
    }
}
